<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>

</body>
<script type="text/javascript">
	ar test_picture = function() {
            api.getPicture({
                    sourceType: 'library',
                    //encodingType: 'jpg',
                    mediaValue: 'pic',
                    destinationType: 'url',
                    allowEdit: true,
                    quality: 50,
                    targetWidth:100,
                    targetHeight:100,
                    saveToPhotoAlbum: false
                },
          function(ret, err){ 
                    if (ret) {
						alert(JSON.stringify(ret))
					 $('.wy_tu img').attr('src',ret.data)
                     api.ajax({
						
					  timeout : 100,
					  method : 'post',
					  url : apiurl,
					  data : {
						  values: {a: 'upload_files'},
						  files:{file : ret.data},
					  },
					  dataType : 'json',
				  }, 
		function(ret, err) {
					  //api.hideProgress();
					  if(ret){
					  //alert(JSON.stringify(ret));
					  alert(JSON.stringify(ret))
					  }else{alert(JSON.stringify(err))}
				  });
						} else {
							api.alert({msg:err.msg});
						};
					});
    };

</script>
</html>